package com.tiny.model;

import java.util.List;

import com.jfinal.plugin.activerecord.Model;

public class Role extends Model<Role>{

	private static final long serialVersionUID = 5721481570867001055L;

	public static final Role dao = new Role();
	
	public long getId() {
		return this.getInt("id");
	}
	
	public List<Permission> getPermissions(){
		return Permission.dao
				.find(" select r.* from permission r,rolepermission rr where rr.permission_id=r.id and rr.role_id =? ",
						this.getId());
	}
}
